package com.sky.mapper.rider;

import com.sky.dto.CourierTradeQueryDto;
import com.sky.pojo.Courier;
import com.sky.pojo.CourierTradeOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

@Mapper
public interface CourierMapper {
    @Select("select * from tb_courier where on_job=1")
    List<Courier> selectCourierByOnJob();
    @Select("select * from tb_courier where id=#{id}")
    Courier selectById(Long id);

    List<Map<String, Long>> selectOrderByToday(@Param("localDate") String localDate,
                                               @Param("list") List<Long> courierIdList);

    List<Long> selectCourierOrdering(@Param("localDate") String localDate,
                                     @Param("list") List<Long> courierIdList);

    List<Courier> findCourierByIds(List<Long> courierIds);
    @Select("select * from tb_courier where telephone=#{telephone}")
    Courier selectByPhone(String telephone);

    List<CourierTradeOrder> selectByList(CourierTradeQueryDto dto);

    CourierTradeOrder selectTradeOrderById(String number);

    CourierTradeOrder selectTradeOrderByTradeNo(String tradeNo);
}
